|
Book details / order |
ANDROID COOKBOOK PROBLEMS AND SOLUTIONS FOR ANDROID DEVELOPERS |
Jump in and build working android apps with the help of more than 200 tested recipes. with this cookbook, you’ll find solutions for working with the user interfaces, multitouch gestures, location awareness, web services, and device features such as the phone, camera, and accelerometer. you also get useful steps on packaging your app for the android market.
ideal for developers familiar with java, android basics, and the java se api, this book features recipes contributed by more than three dozen developers from the android community. each recipe provides a clear solution and sample code you can use in your project right away. among numerous topics, this cookbook helps you:
use guidelines for designing a successful android app
work with ui controls, effective layouts, and graphical elements
learn how to take advantage of android’s rich features in your app
save and retrieve application data in files, sd cards, and embedded databases
access restful web services, rss/atom feeds, and information from websites
create location-aware services to find locations and landmarks, and situate them on google maps and openstreetmap
test and troubleshoot individual components and your entire application
about the author
ian f. darwin has worked in the computer industry for three decades. he wrote the freeware file(1) command used on linux and bsd and is the author of checking c programs with lint, java cookbook, and over seventy articles and courses on c and unix. in addition to programming and consulting, ian teaches unix, c, and java for learning tree international, one of the world's largest technical training companies.
table of contents:
chapter 1 getting started
introduction: getting started
learning the java language
creating a “hello, world” application from the command line
creating a “hello, world” application in eclipse
setting up an ide on windows to develop for android
understanding the android life cycle
installing .apk files onto an emulator via the adb
installing apps onto an emulator via slideme
sharing java classes from another eclipse project
referencing libraries to implement external functionality
using sdk samples to help avoid head scratching
keeping the android sdk updated
taking a screenshot from the emulator/android device
program: a simple countdowntimer example
program: tipster, a tip calculator for the android os
chapter 2 designing a successful application
introduction: designing a successful android application
exception handling
accessing android’s application object as a “singleton”
keeping data when the user rotates the device
monitoring the battery level of an android device
creating splash screens in android
designing a conference/camp/hackathon/institution app
using google analytics in an android application
a simple torch/flashlight
adapting an android phone application to be used on a tablet
setting first-run preferences
formatting the time and date for display
controlling input with keylisteners
backing up android application data
using hints instead of tool tips
chapter 3 testing
introduction: testing
doing test-driven development (tdd) in android
setting up an android virtual device (avd) for app testing
testing on a huge range of devices with cloud-based testing
creating and using a test project
troubleshooting application crashes
debugging using log.d and logcat
getting bug reports from users automatically with bugsense
using a local runtime application log for analysis of field errors or situations
reproducing activity life-cycle scenarios for testing
keeping your app snappy with strictmode
running the monkey program
sending text messages and placing calls between avds
chapter 4 inter-/intra-process communication
introduction: inter-/intra-process communication
opening a web page, phone number, or anything else with an intent
emailing text from a view
sending an email with attachments
pushing string values using intent.putextra()
retrieving data from a subactivity back to your main activity
keeping a service running while other apps are on display
sending/receiving a broadcast message
starting a service after device reboot
creating a responsive application using threads
using asynctask to do background processing
sending messages between threads using an activity thread queue and handler
creating an android epoch html/javascript calendar
chapter 5 content providers
introduction: content providers
retrieving data from a content provider
writing a content provider
writing an android remote service
chapter 6 graphics
introduction: graphics
using a custom font
drawing a spinning cube with opengl es
adding controls to the opengl spinning cube
freehand drawing smooth curves
taking a picture using an intent
taking a picture using android.media.camera
scanning a barcode or qr code with the google zxing barcode scanner
using androidplot to display charts and graphs
using inkscape to create an android launcher icon
creating easy launcher icons from openclipart.org using paint.net
using nine patch files
creating html5 charts with android rgraph
adding a simple raster animation
using pinch to zoom
chapter 7 graphical user interface
introduction: gui
understanding and following user interface guidelines
handling configuration changes by decoupling the view from the model
creating a button and its click event listener
wiring up an event listener in five different ways
using checkboxes and radiobuttons
enhancing ui design using image buttons
offering a drop-down chooser via the spinner class
handling long-press/long-click events
displaying text fields with textview and edittext
constraining edittext values with attributes and the textwatcher interface
implementing autocompletetextview
feeding autocompletetextview using an sqlite database query
turning edit fields into password fields
changing the enter key to “next” on the soft keyboard
processing key-press events in an activity
let them see stars: using ratingbar
making a view shake
providing haptic feedback
navigating different activities within a tabview
creating a custom title bar
formatting numbers
formatting with correct plurals
starting a second screen from the first
creating a loading screen that will appear between two activities
using slidingdrawer to overlap other components
customizing the slidingdrawer component to animate/transition from the top down
adding a border with rounded corners to a layout
detecting gestures in android
building a ui using android 3.0 fragments in android 1.6 and later
using the android 3.0 photo gallery
creating a simple app widget
chapter 8 gui alerts: menus, dialogs, toasts, and notifications
introduction: gui alerts
creating and displaying a menu
handling choice selection in a menu
creating a submenu
creating a pop-up/alert dialog
using a timepicker widget
creating an iphone-like wheel picker for selection
creating a tabbed dialog
creating a progressdialog
creating a custom dialog with buttons, images, and text
creating a reusable about box class
customizing the appearance of a toast
creating a notification in the status bar
chapter 9 gui: listview
introduction: listview
building list-based applications with listview
creating a “no data” view for listviews
creating an advanced listview with images and text
using section headers in listviews
keeping the listview with the user’s focus
writing a custom list adapter
handling orientation changes: from listview data values to landscape charting
chapter 10 multimedia
introduction: multimedia
playing a youtube video
using the gallery with the imageswitcher view
capturing video using mediarecorder
using android’s face detection capability
playing audio from a file
playing audio without interaction
using speech to text
making the device speak with text-to-speech
chapter 11 data persistence
introduction: data persistence
getting file information
reading a file shipped with the app rather than in the filesystem
listing a directory
getting total and free space information about the sd card
providing user preference activity with minimal effort
checking the consistency of default shared preferences
performing advanced text searches
creating an sqlite database in an android application
inserting values into an sqlite database
loading values from an existing sqlite database
working with dates in sqlite
parsing json using jsonobject
parsing an xml document using the dom api
parsing an xml document using an xmlpullparser
adding a contact
reading contact data
chapter 12 telephone applications
introduction: telephone applications
doing something when the phone rings
processing outgoing phone calls
dialing the phone
sending single-part or multipart sms messages
receiving an sms message in an android application
using emulator controls to send sms messages to the emulator
using android’s telephonymanager to obtain device information
chapter 13 networked applications
introduction: networking
using a restful web service
extracting information from unstructured text using regular expressions
parsing rss/atom feeds using rome
using md5 to digest clear text
converting text into hyperlinks
accessing a web page using webview
customizing a webview
chapter 14 gaming and animation
introduction: gaming and animation
building an android game using flixel-android
building an android game using andengine (android-engine)
processing timed keyboard input
chapter 15 social networking
introduction: social networking
integrating social networking using http
loading a user’s twitter timeline using json
chapter 16 location and map applications
introduction: location-aware applications
getting location information
accessing gps information in your application
mocking gps coordinates on a device
using geocoding and reverse geocoding
getting ready for google maps development
adding a device’s current location to google maps
drawing a location marker on a google mapview
drawing multiple location markers on a mapview
creating overlays for a google mapview
changing modes of a google mapview
drawing an overlay icon without using a drawable
implementing location search on google maps
placing a mapview inside a tabview
handling a long-press in a mapview
using openstreetmap
creating overlays in openstreetmap maps
using a scale on an openstreetmap map
handling touch events on an openstreetmap overlay
getting location updates with openstreetmap maps
chapter 17 accelerometer
introduction: sensors
checking for the presence or absence of a sensor
using the accelerometer to detect shaking of the device
checking whether a device is facing up or facing down based on screen orientation using an accelerometer
finding the orientation of an android device using an orientation sensor
reading the temperature sensor
chapter 18 bluetooth
introduction: bluetooth
enabling bluetooth and making the device discoverable
connecting to a bluetooth-enabled device
listening for and accepting bluetooth connection requests
implementing bluetooth device discovery
chapter 19 system and device control
introduction: system and device control
accessing phone network/connectivity information
obtaining information from the manifest file
changing incoming call notification to silent, vibrate, or normal
copying text and getting text from the clipboard
using led-based notifications
making the device vibrate
running shell commands from your application
determining whether a given application is running
chapter 20 other programming languages and frameworks
introduction: other programming languages
running an external/native unix/linux command
running native c/c++ code with jni on the ndk
getting started with the scripting layer for android (sl4a, formerly android scripting environment)
creating alerts in sl4a
fetching your google documents and displaying them in a listview using sl4a
sharing sl4a scripts in qr codes
using native handset functionality from webview via javascript
creating a platform-independent application using phonegap/cordova
chapter 21 strings and internationalization
introduction: internationalization
internationalizing application text
finding and translating strings
handling the nuances of strings.xml
chapter 22 packaging, deploying, and distributing/selling your app
introduction: packaging, deploying, and distributing
creating a signing certificate
signing your application
distributing your application via android play (formerly the android market)
integrating admob into your app
obfuscating and optimizing with proguard
providing a link to other published apps in the google play market.
Author : Ian f. darwin
Publication : Oreilly
Isbn : 9789350237328
Store book number : 105
NRS 1120.00
|
|
|
|
|
|
|
|
|
|